package com.qingke.notlonely.command.system;

import java.util.List;

import com.qingke.notlonely.bean.User;
import com.qingke.notlonely.command.SystemCommand;
import com.qingke.notlonely.util.NLConsole;

public class ListUserByHeight extends SystemCommand{

	@Override
	public void execute() {
		double heightLow=NLConsole.getDouble("height low :");
		double heightHigh;
		while(true){
			heightHigh=NLConsole.getDouble("height high:");
			if(heightHigh<heightLow){
				NLConsole.println("err input.");
				continue;
			}
			break;
		}
		List<User> list=dao.selectUserByHeight(heightLow, heightHigh);
		if(list.size()==0){
			NLConsole.println("no user match condition.");
			return ;
		}
		for(User u:list){
			NLConsole.println(u);
		}
	}

}
